<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="keywords"
        content="富文本编辑器、树形列表、树形控件、树控件、手风琴、拾色器、多文件上传、弹窗组件、模态窗口、双向联动表单、右键菜单、jquery拖动、draggable、datagrid、tree、mvvm、combox、tab" />
    <meta name="description"
        content="Bui editor ui框架是一套前后端分离，包含富文本编辑器、双向联动表单、树形列表、树形控件、模态窗口、手风琴、拾色器、多文件上传、弹窗组件等全功能UI框架。还包括Spring mvc spring mybatis高效开发框架" />
    <link rel="shortcut icon" href="/favicon.ico" />
    <link rel="bookmark" href="/favicon.ico" />
    <meta name="renderer" content="webkit|ie-stand" />
    <link type="text/css" rel="stylesheet"  class="edit_source" lang="stylesheet" href="../theme/default/default-2.0.0.css" />
    <link type="text/css" rel="stylesheet"  class="edit_source" lang="stylesheet" href="../theme/font/bui-fonts.min.css" />
    <link type="text/css" rel="stylesheet"  class="edit_source" lang="stylesheet" href="../theme/default/editor.css" />

    <script type="text/javascript" class="edit_source" src="lang_config.js"></script>
    <script type="text/javascript" class="edit_source" src="../lib/vue.min.js"></script>
    <script type="text/javascript" class="edit_source" src="../javascript/bui-2.0.0.js"></script>
    <script type="text/javascript" src="../javascript/editor-2.0.0.js"></script>
    <script type="text/javascript" class="edit_source" src="../javascript/prpForm-2.0.0.js"></script>

    <script type="text/javascript" src="org.json"></script>
    <style>
        #editor-wrap {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            /* border-top: 40px solid #fff; */
            padding: 0 5px 0px 5px;
        }

        #h0001 {
            line-height: 40px;
            position: absolute;
            top: 0;
            left: 0;
            height: 40px;
            width: 100%;
            padding: 0 30px;
        }
    </style>
</head>

<body>
    <div id="editor-wrap" class="k_box_size">
        <div id="editor">
        </div>
    </div>
    <!-- <h1 id="h0001" class="k_box_size">富文本Demo</h1> -->
    <script type="text/javascript">
        $B.DomUtils.onDomLoaded(function () {
            console.log("on dom loaded......");
            var edtIns = new $B.Keditor("editor", {
                mutilPage: false,
                fileUpload:{
                    timeout: 300, //超时时间 秒
                        url: 'http://127.0.0.1:8888/test/upload',
                        immediate: true, //选择文件后是否立即自动上传，即不用用户点击提交按钮就上传
                        onSelected: function(file,fileName){ //选择文件后的事件请返回true 以便通过验证
                            console.log(fileName);
                            return true;
                        },
                        success: function(mesage, data, res){ //成功时候的回调
                            console.log("success "+mesage);
                        },
                        onDelected: function(res){//删除回调,function(res){ }
                            console.log("delete "+res);
                        },
                        setParams: function(){ //设置参数 return {}
                            return undefined;
                        },
                        error: function (res,err) { //错误回调
                            console.log("error "+res,err);
                        }
                },
                imgUpload:{
                        timeout: 300, //超时时间 秒
                        url: 'http://127.0.0.1:8888/test/uploadImg',
                        immediate: true, //选择文件后是否立即自动上传，即不用用户点击提交按钮就上传
                        onSelected: function(file,fileName){ //选择文件后的事件请返回true 以便通过验证
                            console.log(fileName);
                            return true;
                        },
                        success: function(mesage, data, res){ //成功时候的回调
                            console.log("success "+mesage);
                        },
                        onDelected: function(res){//删除回调,function(res){ }
                            console.log("delete "+res);
                        },
                        setParams: function(){ //设置参数 return {}
                            return undefined;
                        },
                        error: function (res,err) { //错误回调
                            console.log("error "+res,err);
                        }
                }
            });
            edtIns.focus();
        });
    </script>
</body>

</html>